package benchmarks.tpch.mongo.domain;

import benchmarks.tpch.utils.Tuple;

import java.util.Date;

public class PartSupp extends TPCHDomain<Tuple>{
//    TPCHLoaderMySQL.CastTypes.LONG,   // ps_partkey
//    TPCHLoaderMySQL.CastTypes.LONG,   // ps_suppkey
//    TPCHLoaderMySQL.CastTypes.LONG,   // ps_availqty
//    TPCHLoaderMySQL.CastTypes.DOUBLE, // ps_supplycost
//    TPCHLoaderMySQL.CastTypes.STRING  // ps_comment
    private int ps_partkey; //1 //primary
    private int ps_suppkey; //2 //primary
    private int ps_availqty; //3
    private double ps_supplycost; //4
    private String ps_comment; //5

    @Override
    public void setInt(int pos, int value) {
        if (pos == 1) {
            ps_partkey = value;
        }
        else if (pos == 2) {
            ps_suppkey = value;
        }
        else if (pos == 3) {
            ps_availqty = value;
        }
        else {
            System.out.println("Wrong pos");
        }
    }

    @Override
    public void setDouble(int pos, double value) {
        if (pos == 4) {
            ps_supplycost = value;
        } else {
            System.out.println("Wrong pos");
        }
    }

    @Override
    public void setString(int pos, String value) {
        if (pos == 5) {
            ps_comment = value;
        } else {
            System.out.println("Wrong pos");
        }
    }

    @Override
    public void setDate(int pos, Date value) {
        System.out.println("Wrong pos");
    }

    @Override
    public Tuple getPrimaryKey() {
        return new Tuple(ps_partkey, ps_suppkey);
    }

    public int getPs_partkey() {
        return ps_partkey;
    }

    public void setPs_partkey(int ps_partkey) {
        this.ps_partkey = ps_partkey;
    }

    public int getPs_suppkey() {
        return ps_suppkey;
    }

    public void setPs_suppkey(int ps_suppkey) {
        this.ps_suppkey = ps_suppkey;
    }

    public int getPs_availqty() {
        return ps_availqty;
    }

    public void setPs_availqty(int ps_availqty) {
        this.ps_availqty = ps_availqty;
    }

    public double getPs_supplycost() {
        return ps_supplycost;
    }

    public void setPs_supplycost(double ps_supplycost) {
        this.ps_supplycost = ps_supplycost;
    }

    public String getPs_comment() {
        return ps_comment;
    }

    public void setPs_comment(String ps_comment) {
        this.ps_comment = ps_comment;
    }
}
